Backups (dump / restore)
These instructions are fairly pedantic as I use them for setting up my own automated backup system. It should be a generally useful reference though if you're setting up automated backups or an nfs mount. I use Services for Unix on Windows as the NFS server on which to store backups. It should be fairly straightforward to use any other NFS server. Automated Backup #Set up Services for Unix on a Windows server and include the related components such as user name mapping. #Upload the passwd and group files to the server and reference them as the files to use for user name mapping. #In the SFU user interface, set up a map between root and a local user, for example IUSR_MachineName. (This particular example will also enable the locally installed web server to access content shared via nfs, so you may prefer to just create a new user specifically for nfs instead.) #Disable "simple maps" on the "user name mapping" screen. This will prevent standard user accounts on the NetBSD box from having implicit access to nfs shared content. #Create a client group AtariGroup in which the Atari client machine is a member. #Right-click Server for NFS to stop and restart the server. #Right-click User Name Mapping to stop and restart the user name mapping service. #Right-click the directory you want to share in the shell and go to the NFS Sharing tab. #Select to share the folder and give it a name. #Disable anonymous access. #Click Permissions. #Disable ALL MACHINES access and root access for ALL MACHINES. #Add the AtariGroup into the NFS share permissions and set access to Read-Write with root access allowed. #In the Security tab, add IUSR_MachineName or whatever mapped user use used for the NFS permissions previously. #You may want to remove acces to other groups that this account could be a member of, ex: Users. #The advanced permissions for IUSR_MachineName can be set to allow this user only the following permissions: ##Traverse Folder / Execute File ##Read Attributes ##Create Files / Write Data ##Create Folders / Append Data ##Write Attributes #This will restrict directory listing, even for the root user. Read permissions (for restore) will automatically be granted to the created backup files. #Back on the atari, su to root. #You should be able to see the share with showmount -e MachineName #mkdir /AtariBackup #chmod 200 /AtariBackup #mount_nfs -w 65536 MachineName:/AtariBackup /AtariBackup #*Some testing in my own configuration revealed that the -w option specified above gave better transfer rates over 10 megabit ethernet than the default setting. The same value for -r caused the NFS client to lock up, so I'd advise against modifying the -r option. #Now you should be able to copy files to /AtariBackup and see them on the server machine. You shouldn't be able to see a directory listing as root, but you should be able to read the files back if you reference them directly. You shouldn't be able to view /AtariBackup at all as non-root. #To try a full dump manually, do: #Set up a decent backup script. This example uses one from the nixCraft shell script collection, provided here. #Copy the script to ~root/tapebackup.sh #chmod 700 tapebackup.sh #mkdir /var/log/dumps #chmod 700 /var/log/dumps #Edit tapebackup.sh, changing: #*FSL = "/" #**This will set the whole root filesystem for backup. #*TAPE = "/AtariBackup/backup.`date +'%Y%m%d%H%M%S'`" #*opts = "-${level}uantX -f ${tape}" #Save and exit the editor. #crontab -e #Add the following line: #*@midnight /root/tapebackup.sh #Save and exit the editor. #Edit /etc/fstab and add the following to auto-mount the nfs share: #*MachineName:/AtariBackup /AtariBackup nfs rw,-w=65536 #*(use tab instead of spaces above) #Save and exit the editor. #shutdown -r now #Now the system will perform a backup each night. On Monday (Sunday night) it will do a full backup, with subsequent backups in that week being incremental. Restore #To restore individual files: #*cd / #**If you don't do this, the full extracted directory structure will appear under your current directory. #*restore -i -f /AtariBackup/backup.date #*If backup is set up as described above, the last full backup will be on Monday (Sunday night). Incremental backups throughout the week will contain any changes that happened since the previous backup. When restoring, the restore program only operates on the particular file referenced in the command line, not the whole stack of backups created since the last full backup. #Use the commands describe in the restore man page to restore files in interactive mode. Generally speaking, this would be something like: #*cd / ls to examine the backup. #*add filename #*extract #*1 #*quit #Other restore options can be used to restore the entire filesystem, etc. Notes *Once I have an iSCSI target set up I'd like to revisit this to see if there are any benefits to using the iSCSI initiator rather than NFS. *In general, one benefit of switching to a SCSI <--> iSCSI bridge instead of a physical drive is that disk image snapshots may be taken without a long backup process running on the Atari. Once a reasonably priced SCSI <--> iSCSI bridge becomes available this is definitely something to look into further. *Chapter 29 of the NetBSD Guide is a helpful reference regarding NFS. *FreeBSD Handbook Chapter 18.12: Backup Basics is also useful.